# -*- coding=utf-8 -*-
import urllib3
import requests
from urllib3.exceptions import InsecureRequestWarning
from .app_config import AppConfig


class HttpClient(AppConfig):

    @staticmethod
    def request(method, url, params):
        request_timeout = AppConfig.get_config_info()["request_timeout"]
        urllib3.disable_warnings(InsecureRequestWarning)
        response = requests.request(method=method, url=url, params=params, timeout=request_timeout)
        response.close()
        return response
